package net.unix8.bean;

public class WaveDataIndex {
	public long stimeS;
	public long etimeS;
	public long stimeUS;
	public long etimeUS;
	public long points;
	public long rate;
	public String file;
	public WaveDataIndex(){
		points = 0;
	}
	public WaveDataIndex(long stimeS, long etimeS, long stimeUS, long etimeUS, long points, long rate, String file) {
		super();
		this.stimeS = stimeS;
		this.etimeS = etimeS;
		this.stimeUS = stimeUS;
		this.etimeUS = etimeUS;
		this.points = points;
		this.rate = rate;
		this.file = file;
	}


	public String toString(){
		String s = stimeS + " <----> " + etimeS + " <----> "+ stimeUS + " <----> " + etimeUS + "   <----->  " + points+ "   <----->  " + rate;
		return s;
	}
	
	public void setFileTimeStartRecord(long usTime) {
		this.stimeS = usTime;
		//long i = (long)(usTime / 1000000);
		//long f = (long)(usTime % 1000000);
		//this.stimeS = i;
		//this.stimeUS = f;
	}
	public void setFileTimeEndRecord(long usTime) {
		this.etimeS = usTime;
		//long i = (long)(usTime / 1000000);
		//long f = (long)(usTime % 1000000);
		//this.etimeS = i;
		//this.etimeUS = f;
	}
	public void setFileTimeRecord(long start, long end) {
		setFileTimeStartRecord(start);
		setFileTimeEndRecord(end);
	}
	public void setFile(String file){
		this.file = file;
	}
	public void setPointAndRate(long points, long rate){
		this.points = points;
		this.rate = rate;
	}
	public void setRate(long rate){
		this.rate = rate;
	}
	public void addPoint(long p){
		this.points += p;
	}
	/**
	 * 废弃的函数
	 */
	public void calPoints(){
		long i = (long)(stimeS / 1000000);
		long f = (long)(stimeS % 1000000);
		this.stimeS = i;
		this.stimeUS = f;
		
		i = (long)(etimeS / 1000000);
		f = (long)(etimeS % 1000000);
		this.etimeS = i;
		this.etimeUS = f;
	}
	
}
